package com.hlz.lib.effectivejava.chapter2;

/**
 * @author Hongliang Zhu
 * @create 2023-08-20 15:16
 */
public class CalZone extends Pizza {
    private final boolean sauceInside;

    public static class Builder extends Pizza.Builder<Builder> {
        private boolean sauceInside = false; // default

        public Builder sauceInside() {
            this.sauceInside = true;
            return this;
        }

        @Override
        Pizza build() {
            return new CalZone(this);
        }

        @Override
        protected Builder self() {
            return this;
        }
    }

    public CalZone(Builder builder) {
        super(builder);
        sauceInside = builder.sauceInside;
    }
}
